impl Solution {
    pub fn get_max_len(nums: Vec<i32>) -> i32 {
        let mut ans:i32=0;
        let child_slice=nums.split(|num| *num==0);
        for cs in child_slice{
            let mut nev_count=0;
            let mut first_nev:i32=-1;
            let mut last_nev:i32=-1;
            cs.iter().enumerate().for_each(|(ind,val)|{
                if *val<0{
                    if first_nev==-1{
                        first_nev=ind as i32
                    }
                    last_nev=ind as i32;
                    nev_count+=1;
                }
            });
            if nev_count%2==0{
                ans=ans.max(cs.len() as i32)
            }else{
                ans=ans.max(cs.len()as i32-(first_nev+1).min(cs.len()as i32-last_nev));
            }
        } 
        ans
    }   
}